<?php

	
	include("pass.php");
	if($_GET['pass']!=$goodPass){ echo 'badpass'; exit; }

	$blacklist = array(".php", ".phtml", ".php3", ".php4");
	foreach ($blacklist as $item) {
		if(preg_match("/$item\$/i", $_FILES['uploaded_file']['name'])) {
			echo "result=0&info=We do not allow uploading PHP files";
			exit;
		}
	}

	$filename = basename($_FILES['uploaded_file']['name']);
	move_uploaded_file($_FILES['uploaded_file']['tmp_name'], "files/".$filename);
	chmod("files/".$filename, 0755);

	echo "result=1&filename=".$filename;
?>